import React from 'react';
import styles from './Welcome.less';
import { history, connect } from 'umi';

class Welcome extends React.Component {
  state = {
    imgStyle: {}
  }

  componentDidMount() {
    setTimeout(() => {
      this.setState({
        imgStyle: {
          transform: 'rotate(0deg)'
        }
      });
    }, 100);
  }
  render() {
    const {
      currentUser = {
        avatar: '',
        name: '',
      }
    } = this.props;
    const {
      imgStyle
    } = this.state;
    return (
      <div className={styles.welcomePage}>
        <div className={styles.imgWrap}>
          <img className={styles.bgCircle2} style={imgStyle} src={require("../../assets/bgCircle2.png")} />
          <img className={styles.bgCircle3} style={imgStyle} src={require("../../assets/bgCircle3.png")} />
          <img className={styles.bgCircle4} style={imgStyle} src={require("../../assets/bgCircle4.png")} />
        </div>
        <div className={styles.textWrap}>
          <strong>您好 {currentUser.name}</strong>，<br/>
          欢迎访问MBA-ONLINE
        </div>
      </div>
    );
  }
}

export default connect(({ user }) => ({
  currentUser: user.currentUser,
}))(Welcome);
